import axios from "axios"
import userApi from "../api/users"

axios.interceptors.request.use(function (config) {
    // Do something before request is sent

    const token = userApi.getToken()
   token &&  (config["headers"]["authorization"] = `Bearer ${token}`)
    return config;
}, function (error) {
    // Do something with request error
    return Promise.reject(error);
});